package com.runtime.service.impl;

import com.runtime.bean.Tblarea;
import com.runtime.bean.Tblestate;
import com.runtime.clients.AreaClient;
import com.runtime.mapper.EstateMapper;
import com.runtime.service.EstateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EstateServiceImpl implements EstateService {
    @Autowired
    private EstateMapper estateMapper;

    @Autowired
    private AreaClient areaClient;


    @Override
    public Tblestate findById(long estateId) {
        Tblestate tblestate = estateMapper.findById(estateId);
        Tblarea tblarea = areaClient.findById(tblestate.getAreaId());
        tblestate.setTblarea(tblarea);
        return tblestate;
    }
}
